#include <iostream>


using namespace std;



#include "Core/inc/Core.h"
#include "MyClass.h"
#include "MyClass2.h"

class RefClass
{
public:

	RefClass() { std::cout<<"RefClass Created."<<std::endl; }
	~RefClass() { std::cout<<"RefClass Deleted."<<std::endl; }
};

int main()
{
	//MgrClass* myClass = new MgrClass();

	Test::MgrClass::Create();
	MgrClass2::Create();

	Test::MgrClass::Instance()->Update(0.0f);
	MgrClass2::Instance()->Update(0.0f);

	Test::MgrClass::Release();
	MgrClass2::Release();

	//MgrClass::Instance()->Update(0.0f);

	Debug::Assert(false, "This is Assert false.");
	Debug::Trace("%s %d\n", "Fuck ", 33);

	Core::CountPtr<RefClass> p(new RefClass());
	Core::CountPtr<RefClass> w(new RefClass());
	Core::CountPtr<RefClass> q;

	if (p.GetCount() == 1 && w.GetCount() == 1 && q.GetCount() == 0)
	{
		cout<<"Pass..."<<endl;
	}
	else
	{
		cout<<"Failed !"<<endl;
	}

	q = p;
	
	if (p.GetCount() == 2 && w.GetCount() == 1 && q.GetCount() == 2)
	{
		cout<<"Pass..."<<endl;
	}
	else
	{
		cout<<"Failed !"<<endl;
	}	

	p = w;

	if (p.GetCount() == 2 && w.GetCount() == 2 && q.GetCount() == 1)
	{
		cout<<"Pass..."<<endl;
	}
	else
	{
		cout<<"Failed !"<<endl;
	}

	q = 0;

	if (p.GetCount() == 2 && w.GetCount() == 2 && q.GetCount() == 0)
	{
		cout<<"Pass..."<<endl;
	}
	else
	{
		cout<<"Failed !"<<endl;
	}

	q = 0;
	p = 0;
	if (p.GetCount() == 0 && w.GetCount() == 1 && q.GetCount() == 0)
	{
		cout<<"Pass..."<<endl;
	}
	else
	{
		cout<<"Failed !"<<endl;
	}

	w = 0;
	if (p.GetCount() == 0 && w.GetCount() == 0 && q.GetCount() == 0)
	{
		cout<<"Pass..."<<endl;
	}
	else
	{
		cout<<"Failed !"<<endl;
	}

	int x;
	cin>>x;
}

//// typical game
//
//void createSingleton()
//{
//	InputManager::Create();
//	AIManager::Create();
//	PhysicsManager::Create();
//	AnimManager::Create();
//	VisualManager::Create();
//	SoundManager();
//
//	// Custom Manager
//	MorphManager::Create();
//	FireManager::Create();
//	JumpManager::Create();
//}
//
//void releaseSingleton()
//{
//	InputManager::Release();
//	AIManager::Release();
//	PhysicsManager::Release();
//	AnimManager::Release();
//	VisualManager::Release();
//	SoundManager();
//
//	// Custom Manager
//	MorphManager::Release();
//	FireManager::Release();
//	JumpManager::Release();
//}
//
//void updateSingleton(float delta)
//{
//	InputManager::Instance()->Update(delta);
//
//	MorphManager::Instance()->Update(delta);
//
//	AIManager::Instance()->Update(delta);
//
//	m_deltaAccum += delta;
//	if (m_deltaAccum > 0.1f) // update physics every 0.1 sec
//	{
//		PhysicsManager::Instance()->Update(delta + m_deltaAccum);
//		JumpManager::Instance()->Update(delta + m_deltaAccum);
//
//		m_deltaAccum = 0.0f;
//	}
//
//	FireManager::Instance()->Update(delta);
//	AnimManager::Instance()->Update(delta);
//	VisualManager::Instance()->Update(delta);
//	SoundManager::Instance()->Update(delta);
//}